package com.lb.spring.demo.action;

import com.lb.spring.demo.service.IQueryService;
import com.lb.spring.framework.annotation.LbAutowired;
import com.lb.spring.framework.annotation.LbController;
import com.lb.spring.framework.annotation.LbRequestMapping;
import com.lb.spring.framework.annotation.LbRequestParam;
import com.lb.spring.framework.webmvc.servlet.LbModelAndView;

import java.util.HashMap;
import java.util.Map;

/**
 * @Title: PageAction
 * @Description: TODO
 * @Author lb
 * @Date 2019/04/19  16:26
 */
@LbController
public class PageAction {

    @LbAutowired
    IQueryService queryService;
    @LbRequestMapping("/first.html")
    public LbModelAndView query(@LbRequestParam("teacher") String teacher){
        String result = queryService.query(teacher);
        Map<String,Object> model = new HashMap<String,Object>();
        model.put("teacher", teacher);
        model.put("data", result);
        model.put("token", "123456");
        return new LbModelAndView("first.html",model);
    }
}
